<?php
namespace app\index\model;

use think\Model;

class Order extends Model
{
    protected $pk = 'id';
    public static function orderList($id)
    {
        $list = Order::alias('o')
            ->where('o.uid','=',$id)
            ->field('o.*,os.order_status')
            ->join('order_status os','o.status=os.status_id')
            ->select();
        return $list;
    }
    public static function orderInfo($id)
    {
        $list = Order::alias('o')
            ->where('o.id','=',$id)
            ->where('o.uid','=',session('user'))
            ->field('o.*,os.order_status,c.name as sheng,cc.name as city,ccc.name as quyu')
            ->join('order_status os','o.status=os.status_id')
            ->join('china_city c','c.id=o.asheng')
            ->join('china_city cc','cc.id=o.acity')
            ->join('china_city ccc','ccc.id=o.aquyu')
            ->find();
        return $list;
    }


}